﻿<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
	<?php $this->load->view('common/top', array('title' => 'SEWIKI - REGISTER')); ?>
	<body>
<script src="<?=base_url() . 'static/js/jquery.validate.js'?>" type="text/javascript"></script>
<script type="text/javascript">
$().ready(function() {
	$("#regist_form").validate({
		rules: {
			username: {
				required: true,
				minlength: 2
			},
			password: {
				required: true,
				minlength: 5
			},
			confirm_password: {
				required: true,
				minlength: 5,
				equalTo: "#password"
			},
			email: {
				required: true,
				email: true
			},
			agree: "required"
		},
		messages: {
			username: {
				required: "请输入用户名",
				minlength: "用户名至少包含两个字符"
			},
			password: {
				required: "请输入密码",
				minlength: "密码至少5个字符长"
			},
			confirm_password: {
				required: "请确认密码",
				minlength: "密码至少5个字符长",
				equalTo: "密码与上面不同"
			},
			email: "请输入合法邮件地址"
		}
	});
	
	$("#password").blur(function() {
		$("#confirm_password").valid();
	});
});
</script>
		<div id="container">
			<?php $this->load->view('common/header') ?>
			<div id="content">
				<div id="regist_msg">
					<?php if($this->session->userdata('regist_error') == true): ?>
						<?php echo $this->session->userdata('regist_error_msg');?>
						<?php $this->session->unset_userdata('regist_error'); ?>
						<?php $this->session->unset_userdata('regist_error_msg'); ?>
					<?php endif; ?>
				</div>
				<div id="regist_form_1">
					<?php echo form_open('', array('id' => 'regist_form'));  ?>
						<table id="regist_table" style="margin:auto;background:#eee">
							<tr>
								<td><?php echo form_label('用户名', 'username') ?></td>
								<td><?php echo form_input(array(
										'name'        => 'username',
										'id'          => 'username',
										'value'       => '请输入用户名',
										'onMouseOver' => 'this.focus()',
										'onMouseOut'  => 'if(this.value==\'\')this.value=\'请输入用户名\';',
										'onFocus'     => 'this.select()',
										'onClick'     => 'if(this.value==\'请输入用户名\') this.value=\'\';')) ?></td>
							</tr>
							<tr>
								<td><?php echo form_label('密码', 'password') ?></td>
								<td><?php echo form_password(array(
										'name'        => 'password',
										'id'          => 'password',
										'value'       => '请输入密码',
										'onMouseOver' => 'this.focus()',
										'onMouseOut'  => 'if(this.value==\'\')this.value=\'请输入密码\';',
										'onFocus'     => 'this.select()',
										'onClick'     => 'if(this.value==\'请输入密码\') this.value=\'\';')) ?></td>
							</tr>
							<tr>
								<td><?php echo form_label('确认密码', 'confirm_password') ?></td>
								<td><?php echo form_password(array(
										'name'        => 'confirm_password',
										'id'          => 'confirm_password',
										'value'       => '请确认密码',
										'onMouseOver' => 'this.focus()',
										'onMouseOut'  => 'if(this.value==\'\')this.value=\'请确认密码\';',
										'onFocus'     => 'this.select()',
										'onClick'     => 'if(this.value==\'请输入密码\') this.value=\'\';')) ?></td>
							</tr>
							<tr>
								<td><?php echo form_label('电子邮件', 'email') ?></td>
								<td><?php echo form_input(array(
										'name'        => 'email',
										'id'          => 'email',
										'value'       => '请输入电子邮件',
										'onMouseOver' => 'this.focus()',
										'onMouseOut'  => 'if(this.value==\'\')this.value=\'请输入电子邮件\';',
										'onFocus'     => 'this.select()',
										'onClick'     => 'if(this.value==\'请输入电子邮件\') this.value=\'\';')) ?></td>
							</tr>
							<tr>
								<td><?php echo form_label('兴趣领域', 'interest') ?></td>
								<td><?php echo form_input('interest') ?></td>
							</tr>
							<tr>
								<td><?php echo form_label('自我介绍', 'quote') ?></td>
								<td><?php echo form_textarea('quote') ?></td>
							</tr>
							<tr>
								<td colspan="2" style="text-align:center">
									<?php echo form_submit('regist', '注册') ?>
									<?php echo form_reset('reset', '重置') ?>
								</td>
							</tr>
						</table>
					<?php echo form_close(); ?>
				</div>
			</div>
			<?php $this->load->view('common/footer') ?>
		</div>
	</body>
</html>